import request from '@/utils/request'

// 查询资源信息列表
export function listInfo(query) {
  return request({
    url: '/resource/info/list',
    method: 'get',
    params: query
  })
}

// 查询资源信息详细
export function getInfo(id) {
  return request({
    url: '/resource/info/' + id,
    method: 'get'
  })
}

// 新增资源信息
export function addInfo(data) {
  return request({
    url: '/resource/info',
    method: 'post',
    data: data
  })
}

// 修改资源信息
export function updateInfo(data) {
  return request({
    url: '/resource/info',
    method: 'put',
    data: data
  })
}

// 删除资源信息
export function delInfo(id) {
  return request({
    url: '/resource/info/' + id,
    method: 'delete'
  })
}

// 获取屏保时间
export function getScreenTime() {
  return request({
    url: '/time',
    method: 'get'
  })
}

// 设置屏保时间
export function setScreenTime(mins, showed) {
  return request({
    url: `time?mins=${mins}&showed=${showed}`,
    method: 'post'
  })
}
